include ../Makefile.global

UNITS = \
	testgtk.cpp

UNITS_H = $(UNITS:.cpp=.h)
UNITS_O = $(UNITS:.cpp=.o)
FORMS = $(UNITS:.cpp=.xfm)
TDSs = $(UNITS:.cpp=.tds)

SOURCES = \
	$(UNITS)

HEADERS = \
	$(SOURCES:.cpp=.h) \
	$(UNITS_H)

OBJECTS = $(SOURCES:.cpp=.o)

TESTGTK = testgtk
BPLVISUAL = bplvisual.a
CACHE = clx69.csm
CFLAGS = -t -Od -H=$(CACHE) -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- -c -w-par
CFLAGS2 = -D_DEBUG -D -n.
LFLAGS = -D"" -aa -Tpe -x -Gn -v
CLIBS = rtl.a rtle.a libborcrtl.a libborunwind.a libc.so
LLIBS = borinit.o crt1.o
LIBVISUAL = libvisual.so
LPATH = -L/usr/local/vpe/lib:/usr/local/vpe/packages/visual/lib:/usr/local/vpe/packages/visual:/usr/local/vpe/lib

all: $(FORMS) $(HEADERS) $(SOURCES) $(OBJECTS)
	@$(LINK) $(LFLAGS) $(LPATH) $(LLIBS) $(OBJECTS), $(TESTGTK),, $(CLIBS) $(BPLVISUAL) $(LIBVISUAL),, $(RESFILE)

.cpp.o: $(FORMS) $(HEADERS) $(SOURCES)
	$(CXX) $(CFLAGS) $(INCLUDES) $(CFLAGS2) $<

clean: $(SUBDIRS)
	@rm -rfv $(OBJECTS) $(VPE) $(VPE).tds $(TESTGTK) $(TDSs) $(CACHE)
